package cn.com.headfree.xxk.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gta.edu.sdk.common.dto.ResultData;

import cn.com.headfree.base.controller.ExBaseController;
import cn.com.headfree.entity.isc.User;
import cn.com.headfree.xxk.service.IMessageCardService;

/**
 * 青年人才信息卡模块
 *
 * @author xuliang
 */
@Controller
@RequestMapping(value = "/message", produces = "application/json;charset=UTF-8")
public class MessageController extends ExBaseController{
	
	 private static final Logger LOG = LogManager.getLogger(MessageController.class);
	 
	 @Autowired
	 private IMessageCardService messageCardService;
	 /**
	  * 导出青年人才信息卡
	  * @param erpNos
	  * @param deptId
	  * @param deptName
	  * @return
	  */
//	    @RequestMapping("/messagCardExport")
	 	@RequestMapping("/exportExcel")
	    public ResultData messagCardExport(HttpServletResponse response,HttpServletRequest request,String erpNos,String deptId,String deptName) {
	        ResultData rs = new ResultData();
	        try {
	            rs = messageCardService.messagCardExport(request,response,erpNos,deptId,deptName);
	        } catch (Exception e) {
	            rs.setSuccess(false);
	            rs.setErrorMsg("青年人才信息卡导出失败！");
	            rs.setData("青年人才信息卡导出失败！");
	            LOG.error("青年人才信息卡导出失败！", e);
	        }
	        return rs;
	    }

}
